package com.china.bank.demo.controller;

import io.swagger.annotations.Api;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * Description: 一个Restful服务（接口） .<br>
 *
 * @author m-xy
 *     Created By 2019/10/22 14:47
 */
@Api(tags = "首页测试")
@RestController
public class InfoController {

    /**
     * 欢迎Info .
     *
     * @return ResponseEntity.
     */
    @RequestMapping(value = "/info", method = RequestMethod.GET,
                    produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseEntity info() {
        return ResponseEntity.ok(new HashMap<String, String>(2) {
            {
                put("name", "中国银行");
                put("welcome", "中国银行欢迎您");
            }
        });
    }
}
